From 6bd6fa26de5392365dcd9744664f95621e15a429 Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Mon, 1 Dec 2003 22:10:44 +0000 Subject: [PATCH] bitkeeper revision 1.636.2.1 (3fcbbc64x-OxidVggJZzaY-7ZkmmVw) xc_misc.c: mlock console buffer. --- tools/xc/lib/xc_misc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/xc/lib/xc_misc.c b/tools/xc/lib/xc_misc.c index dfb550e871..e4efec4a41 100644 --- a/tools/xc/lib/xc_misc.c +++ b/tools/xc/lib/xc_misc.c @@ -35,9 +35,14 @@ int xc_readconsolering(int xc_handle, op.u.readconsole.count = max_chars; op.u.readconsole.cmd = clear ? CONSOLE_RING_CLEAR : 0; - if ( (ret = do_dom0_op(xc_handle, &op)) > 0 ) + if ( (ret = mlock(str, max_chars)) != 0 ) + return ret; + + if ( (ret = do_dom0_op(xc_handle, &op)) >= 0 ) str[ret] = '\0'; + (void)munlock(str, max_chars); + return ret; } -- 2.30.2